<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>ManagerManager for Modx: Function reference: Fields </title>
<link href="css/mm.css" rel="stylesheet" type="text/css" />


</head>

<body>

<div id="banner">

</div>


<div id="main">
    <div id="nav">
        <ul>
            <li><a href="index.htm">Introduction</a></li>
            <li><a href="install.htm">Installation</a></li>
            <li><a href="getting-started.htm">Getting started</a></li>
            <li><a href="field-names.htm">Field names</a></li>
            <li><a href="fields.htm">Fields</a></li>
            <li>Tabs</li>
            <li><a href="widgets.htm">Widgets</a></li>
            <li><a href="sections.htm">Sections</a></li>
            <li><a href="changelog.htm">Changelog</a></li>
        </ul>   
    </div>
    
  <div id="content">
      <h1>Function reference: Tabs</h1>
      <h2>mm_renameTab($tab, $newlabel, $roles, $templates)</h2>
      <p>Renames one of the default tabs within the manager.</p>
      <p><strong>$tab: </strong>The name of the tab this should apply to (from table above). Can only accept single field [Required]<br />
          <strong>$newlabel:</strong> The new text for the label[Required]<br />
          <strong>$roles:</strong> comma separated list of role IDs this should be applied to. Leave empty (or omit) for all roles [Optional - default is all]<br />
          <strong>$templates:</strong> comma separated list of template IDs this should be applied to. Leave empty (or omit) for all templates [Optional - default is all]</p>
      <p><code>mm_renameTab('general', 'Basics', '2'); // Rename the general tab for users with role &quot;2&quot;</code><code>mm_renameTab('access', 'Access control'); // Rename the access permissions tab to &quot;Access control&quot; for all users</code></p>
      <h2>mm_hideTabs($tabs,  $roles, $templates)</h2>
      <p>Hides one or more of the default tabs within the manager.</p>
      <p><strong>$tabs: </strong>The name(s) of the tabs this should apply to (from table above). Can  accept multiple fields separated by commas [Required]<br />
          <strong>$roles:</strong> comma separated list of role IDs this should be applied to. Leave empty (or omit) for all roles [Optional - default is all]<br />
          <strong>$templates:</strong> comma separated list of template IDs this should be applied to. Leave empty (or omit) for all templates [Optional - default is all]</p>
      <code>mm_hideTabs('settings, access'); // Hide the settings and access tabs for all users</code><code>mm_hideTabs('access', '1', '3'); // Hide the access control tab for users with role &quot;1&quot; editing documents using template ID &quot;3&quot;</code>
      <h2>mm_createTab($name,  $id, $roles, $templates, $intro, $width)</h2>
      <p>Creates a new tab within the document editing page</p>
      <p><strong>$name: </strong>The display name of the new tab [Required]<br />
          <strong>$id:</strong> A unique ID for this tab, so you can reference it later on, if you need to [Required]<br />
          <strong>$roles:</strong> comma separated list of role IDs this should be applied to. Leave empty (or omit) for all roles [Optional - default is all]<br />
          <strong>$templates:</strong> comma separated list of template IDs this should be applied to. Leave empty (or omit) for all templates [Optional - default is all]<br />
          <strong>$intro:</strong> HTML text which appears at the top of the new tab [Optional]<strong><br />
            $width:</strong> New width for the content within the tab. If no units are included, they will be assumed to be pixels e.g. &quot;100%&quot; or &quot;450px&quot; [Optional]</p>
      <code>mm_createTab('Categories', 'mycats'); // Create a new tab named &quot;Categories&quot; for all users and templates</code><code>mm_createTab('Categories', 'mycats', '', '3,4', '&lt;p&gt;How should this document be categorised?&lt;/p&gt;', '450'); // Create a new tab 450 pixels wide called categories with an introductory paragraph which is only applied to templates 3 and 4</code>
      <h2>mm_moveFieldsToTab($fields,  $newtab_id, $roles, $templates)</h2>
      <p>Moves fields to a different tab. You can also move TVs to a different tab -- their name must be prefixed by &quot;tv&quot;. However you can't move the following fields: keywords, metatags, which_editor, content, show_in_menu, menuindex</p>
      <p><strong>$fields: </strong><strong></strong>The name(s) of the fields this should apply to (from table above). Can  accept multiple fields separated by commas [Required]<br />
          <strong>$newtab_id:</strong> The ID of the tab which the fields should be moved to. Can be one of the default tab IDs (from table above) or a new custom tab created with mm_createTab [Required]<br />
          <strong>$roles:</strong> comma separated list of role IDs this should be applied to. Leave empty (or omit) for all roles [Optional - default is all]<br />
          <strong>$templates:</strong> comma separated list of template IDs this should be applied to. Leave empty (or omit) for all templates [Optional - default is all]<br />
      </p>
      <code>mm_moveFieldsToTab('pub_date,pagetitle', 'mycats'); // Move publication date and page title to the newly created &quot;mycats&quot; tab</code><code>mm_moveFieldsToTab('pub_date', 'general', '2', ''); // Move the publication date field to the general tab for users with role &quot;2&quot;</code><code>mm_moveFieldsToTab('tvtags', 'mycats'); // Move the TV &quot;tags&quot; to the new &quot;Categories&quot; tab for all users</code>
      <p>&nbsp;</p>
  </div>
</div>
</body>
</html>
